Medallion Architecture

What is the Medallion Architecture and why is it used?


  • The Medallion Architecture is a layered data-processing approach that progressively improves data quality and usefulness as data moves through Bronze → Silver → Gold.
  • Bronze (raw): Ingests and preserves source data with minimal transformation, providing an auditable starting point and a way to reprocess data if needed.
  • Silver (cleaned): Validates, standardises, deduplicates or enriches Bronze data so it is consistent and reliable for further analysis.
  • Gold (business-ready): Produces curated, often aggregated datasets designed for specific reporting, analytics or business questions.
  • Keeping layers separate makes pipelines easier to maintain, troubleshoot and reuse; transformations can be rebuilt from earlier layers when requirements change.

How do you build a Bronze, Silver and Gold pipeline in Databricks?


  • Bronze: Locate source CSV files in a Unity Catalog volume, create a Delta table such as current_employees_bronze, and ingest files using COPY INTO.
  • Silver: Transform Bronze records into current_employees_silver, for example with UPPER(Role) to standardise role values and current_timestamp() to add a processing/audit timestamp.
  • Other Silver transformations may include UPPER(Country) and ROW_NUMBER() OVER (...) to number records in a defined order; ROW_NUMBER() does not remove duplicates unless you also filter its results.
  • Gold: Aggregate Silver data with GROUP BY, for example counting employees by role or country. A temporary view can hold the aggregation before writing it to a Gold Delta table such as total_roles_gold.
  • INSERT OVERWRITE replaces the Gold table’s existing data with the new query result, making it useful for full-refresh aggregations. Confirm the overwrite covers the intended dataset before running it.
  • Query each layer to check that ingestion, transformations and aggregations produced the expected results.

How can Unity Catalog help govern and troubleshoot a Medallion pipeline?


  • Lineage in Catalog Explorer shows upstream and downstream dependencies between supported tables and queries, helping trace Gold results back through Silver to Bronze.
  • Permissions control who can access or modify data assets at each layer; users also need the appropriate privileges on parent catalogs and schemas.
  • Insights can show usage and query activity, helping identify how datasets are consumed.
  • Review these features to understand the impact of changes, investigate data issues and manage access across layers.

How do you automate a Medallion pipeline using Lakeflow Jobs?


  • In Jobs & Pipelines, create a job and add notebooks as tasks, such as Setup-Bronze followed by Silver-Gold.
  • Configure Silver-Gold to depend on Setup-Bronze, so the downstream task runs only after its prerequisite succeeds.
  • Run the job manually with Run Now, or configure supported schedule or file-arrival triggers for repeat execution.
  • Inspect each task’s run status, logs and output to diagnose failures.
  • Verify the job-created Bronze, Silver and Gold tables with SQL and compare their results against manually created tables; automation should reproduce the same transformations without manual notebook execution.